<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .warp {
      border: 1px solid red;
      display: inline-block;
    }

    .text {
      margin: 20px;
      background: green;
    }
  </style>
</head>

<body>
  <div class="warp">
    <span class="text">文本一</span>
    <span class="text">文本二</span>
  </div>
  <div>
    左右margin撑开，上下margin并未撑开，符合IFC规范，只计算横向样式控件，不计算纵向样式空间。
  </div>
</body>

</html>